package com.example.shushiyunsst.fragment.main.home.child.new_sale.chlid.bean;

import java.util.ArrayList;
import java.util.List;

public class GoodTypeBean {

    private String mTypeName;

    private List<GoodTypeSubBean> subList = new ArrayList<>();

    private GoodTypeSubBean selectedItem;

    public GoodTypeSubBean getSelectedItem() {
        return selectedItem;
    }

    public void setSelectedItem(GoodTypeSubBean selectedItem) {
        this.selectedItem = selectedItem;
    }

    public boolean isEqualsSelectedItem(GoodTypeSubBean item) {
        if (item == null || selectedItem == null) return false;
        return selectedItem.isEquals(item);
    }

    public List<GoodTypeSubBean> getSubList() {
        if (subList == null) subList = new ArrayList<>();
        return subList;
    }

    public void setSubList(List<GoodTypeSubBean> subList) {
        this.subList = subList;
        if (this.subList != null) {
            for (GoodTypeSubBean subBean : this.subList) {
                subBean.setTypeName(mTypeName);
            }
        }
    }

    public String getTypeName() {
        return mTypeName;
    }

    public void setTypeName(String mTypeName) {
        this.mTypeName = mTypeName;
    }
}
